[homer:osborne:LAB102] /home/osborne/scripts > ps -ef | grep pmon
oracle   32273     1  0 Aug13 ?        00:00:19 ora_pmon_LAB102
oracle    1572     1  0 Aug14 ?        00:00:14 ora_pmon_RANDY102
oracle   11005     1  0 Aug14 ?        00:00:26 ora_pmon_LAB111
osborne  13960  2930  0 15:23 pts/3    00:00:00 grep pmon

[homer:osborne:LAB102] /home/osborne/scripts > ps -ef | grep LAB111
oracle   10983     1  0 Aug14 ?        00:00:09 ora_pmon_LAB111
oracle   10985     1  0 Aug14 ?        00:00:01 ora_vktm_LAB111
oracle   10989     1  0 Aug14 ?        00:00:00 ora_diag_LAB111
oracle   10991     1  0 Aug14 ?        00:00:00 ora_dbrm_LAB111
oracle   10993     1  0 Aug14 ?        00:00:12 ora_psp0_LAB111
oracle   10997     1  0 Aug14 ?        00:01:26 ora_dia0_LAB111
oracle   10999     1  0 Aug14 ?        00:00:11 ora_mman_LAB111
oracle   11001     1  0 Aug14 ?        00:00:16 ora_dbw0_LAB111
oracle   11003     1  0 Aug14 ?        00:00:14 ora_dbw1_LAB111
oracle   11005     1  0 Aug14 ?        00:00:26 ora_lgwr_LAB111
oracle   11007     1  0 Aug14 ?        00:01:08 ora_ckpt_LAB111
oracle   11009     1  0 Aug14 ?        00:00:26 ora_smon_LAB111
oracle   11011     1  0 Aug14 ?        00:00:00 ora_reco_LAB111
oracle   11013     1  0 Aug14 ?        00:01:01 ora_mmon_LAB111
oracle   11015     1  0 Aug14 ?        00:00:40 ora_mmnl_LAB111
oracle   11017     1  0 Aug14 ?        00:00:00 ora_d000_LAB111
oracle   11019     1  0 Aug14 ?        00:00:00 ora_s000_LAB111
oracle   11029     1  0 Aug14 ?        00:00:03 ora_fbda_LAB111
oracle   11031     1  0 Aug14 ?        00:00:00 ora_smco_LAB111
oracle   11035     1  0 Aug14 ?        00:00:00 ora_qmnc_LAB111
oracle   11072     1  0 Aug14 ?        00:00:00 ora_q000_LAB111
oracle   11243     1  0 Aug14 ?        00:00:33 ora_cjq0_LAB111
oracle   11279     1  0 Aug14 ?        00:00:01 ora_q001_LAB111
oracle   14170     1  0 Aug14 ?        00:00:29 /opt/oracle/product/db/11.1.0/db1/perl/bin/perl /opt/oracle/product/db/11.1.0/db1/bin/emwd.pl dbconsole /opt/oracle/product/db/11.1.0/db1/homer.enkitec.com_LAB111/sysman/log/emdb.nohup
oracle   14202 14170  0 Aug14 ?        00:13:28 /opt/oracle/product/db/11.1.0/db1/jdk/bin/java -server -Xmx256M -XX:MaxPermSize=200m -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=40 -DORACLE_HOME=/opt/oracle/product/db/11.1.0/db1 -Doracle.home=/opt/oracle/product/db/11.1.0/db1/oc4j -Doracle.oc4j.localhome=/opt/oracle/product/db/11.1.0/db1/homer.enkitec.com_LAB111/sysman -DEMSTATE=/opt/oracle/product/db/11.1.0/db1/homer.enkitec.com_LAB111 -Doracle.j2ee.dont.use.memory.archive=true -Djava.protocol.handler.pkgs=HTTPClient -Doracle.security.jazn.config=/opt/oracle/product/db/11.1.0/db1/oc4j/j2ee/OC4J_DBConsole_homer.enkitec.com_LAB111/config/jazn.xml -Djava.security.policy=/opt/oracle/product/db/11.1.0/db1/oc4j/j2ee/OC4J_DBConsole_homer.enkitec.com_LAB111/config/java2.policy -Djavax.net.ssl.KeyStore=/opt/oracle/product/db/11.1.0/db1/sysman/config/OCMTrustedCerts.txt-Djava.security.properties=/opt/oracle/product/db/11.1.0/db1/oc4j/j2ee/home/config/jazn.security.props -DEMDROOT=/opt/oracle/product/db/11.1.0/db1/homer.enkitec.com_LAB111 -Dsysman.md5password=true -Drepapi.oracle.home=/opt/oracle/product/db/11.1.0/db1 -Ddisable.checkForUpdate=true -Doracle.sysman.ccr.ocmSDK.websvc.keystore=/opt/oracle/product/db/11.1.0/db1/jlib/emocmclnt.ks -Dice.pilots.html4.ignoreNonGenericFonts=true -Djava.awt.headless=true -jar /opt/oracle/product/db/11.1.0/db1/oc4j/j2ee/home/oc4j.jar -config /opt/oracle/product/db/11.1.0/db1/oc4j/j2ee/OC4J_DBConsole_homer.enkitec.com_LAB111/config/server.xml
oracle   14284     1  0 Aug14 ?        00:01:45 oracleLAB111 (LOCAL=NO)
oracle   14321     1  0 Aug14 ?        00:00:21 oracleLAB111 (LOCAL=NO)
oracle   14325     1  0 Aug14 ?        00:00:34 oracleLAB111 (LOCAL=NO)
oracle   14332     1  0 Aug14 ?        00:00:41 oracleLAB111 (LOCAL=NO)
oracle   14532     1  0 Aug14 ?        00:00:47 oracleLAB111 (LOCAL=NO)
oracle   14534     1  0 Aug14 ?        00:04:22 oracleLAB111 (LOCAL=NO)
oracle   14538     1  0 Aug14 ?        00:00:32 oracleLAB111 (LOCAL=NO)
oracle   14542     1  0 Aug14 ?        00:00:51 oracleLAB111 (LOCAL=NO)
oracle   14546     1  0 Aug14 ?        00:00:10 oracleLAB111 (LOCAL=NO)
oracle   14550     1  0 Aug14 ?        00:01:35 oracleLAB111 (LOCAL=NO)
oracle   14563     1  0 Aug14 ?        00:00:19 oracleLAB111 (LOCAL=NO)
oracle   18093     1  0 Aug14 ?        00:00:18 oracleLAB111 (LOCAL=NO)
oracle   29733     1  0 Aug14 ?        00:00:01 ora_w000_LAB111
oracle   13894     1  0 15:22 ?        00:00:00 ora_j000_LAB111
osborne  13966  2930  0 15:23 pts/3    00:00:00 grep LAB111


[homer:osborne:LAB102] sudo - oracle

[homer:oracle:LAB102] /home/oracle
> strace -p 11005
Process 11005 attached - interrupt to quit
gettimeofday({1187296912, 164650}, NULL) = 0
gettimeofday({1187296912, 164987}, NULL) = 0
gettimeofday({1187296912, 165311}, NULL) = 0
gettimeofday({1187296912, 165610}, NULL) = 0
getrusage(RUSAGE_SELF, {ru_utime={10, 583391}, ru_stime={16, 179540}, ...}) = 0
gettimeofday({1187296912, 166409}, NULL) = 0
getrusage(RUSAGE_SELF, {ru_utime={10, 583391}, ru_stime={16, 179540}, ...}) = 0
gettimeofday({1187296912, 167170}, NULL) = 0
gettimeofday({1187296912, 167472}, NULL) = 0
gettimeofday({1187296912, 167767}, NULL) = 0
gettimeofday({1187296912, 168067}, NULL) = 0
gettimeofday({1187296912, 168398}, NULL) = 0
times(NULL)                             = 473894837
gettimeofday({1187296912, 168768}, NULL) = 0
gettimeofday({1187296912, 168949}, NULL) = 0
semtimedop(1179651, 0xfeffe504, 1, {1, 190000000}) = -1 EAGAIN (Resource temporarily unavailable)
gettimeofday({1187296913, 360676}, NULL) = 0
gettimeofday({1187296913, 361017}, NULL) = 0
gettimeofday({1187296913, 361313}, NULL) = 0
gettimeofday({1187296913, 361652}, NULL) = 0
gettimeofday({1187296913, 362004}, NULL) = 0
gettimeofday({1187296913, 362307}, NULL) = 0
gettimeofday({1187296913, 362636}, NULL) = 0
times(NULL)                             = 473894957
gettimeofday({1187296913, 363294}, NULL) = 0
gettimeofday({1187296913, 363636}, NULL) = 0
gettimeofday({1187296913, 363988}, NULL) = 0
times(NULL)                             = 473894957
times(NULL)                             = 473894957
gettimeofday({1187296913, 364876}, NULL) = 0
gettimeofday({1187296913, 365273}, NULL) = 0
gettimeofday({1187296913, 365591}, NULL) = 0
gettimeofday({1187296913, 365892}, NULL) = 0
gettimeofday({1187296913, 366195}, NULL) = 0
gettimeofday({1187296913, 366458}, NULL) = 0
gettimeofday({1187296913, 366760}, NULL) = 0
gettimeofday({1187296913, 367069}, NULL) = 0
gettimeofday({1187296913, 367385}, NULL) = 0
gettimeofday({1187296913, 367683}, NULL) = 0
gettimeofday({1187296913, 367987}, NULL) = 0
times(NULL)                             = 473894957
gettimeofday({1187296913, 368529}, NULL) = 0
gettimeofday({1187296913, 368835}, NULL) = 0
semtimedop(1179651, 0xfeffe504, 1, {3, 0} <unfinished ...>
Process 11005 detached

[homer:osborne:LAB102] /home/osborne/scripts > nohup burn_cpu.sh &

[homer:osborne:LAB102] /home/osborne/scripts > vmstat 2
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs us sy id wa
 4  0      0 10255448 600184 20638696    0    0     0     4    0     6  0  0 100  0
 4  0      0 10263256 600184 20638696    0    0     0     0 1191   621 24  1 75  0
 4  0      0 10259992 600184 20638696    0    0     0    62 1022   733 24  1 74  0
 4  0      0 10259992 600184 20638696    0    0     0   126 1030   498 24  1 75  0
 4  0      0 10259736 600184 20638696    0    0     0     4 1020   621 24  1 75  0
 4  0      0 10259736 600184 20638696    0    0     0   236 1039   524 24  1 75  0
 4  0      0 10259736 600184 20638696    0    0     0   126 1033   524 24  1 75  0
 4  0      0 10259864 600184 20638696    0    0     0    52 1018   513 24  1 75  0
 4  0      0 10259864 600184 20638696    0    0     0    48 1027   477 24  1 75  0


[homer:osborne:LAB102] /home/osborne/scripts > top

top - 18:28:26 up 4 days,  6:23,  1 user,  load average: 3.31, 2.54, 2.37
Tasks: 286 total,   3 running, 283 sleeping,   0 stopped,   0 zombie
Cpu(s): 11.9% us,  5.1% sy,  0.0% ni, 78.7% id,  4.2% wa,  0.1% hi,  0.0% si
Mem:  33274528k total, 22321064k used, 10953464k free,   599904k buffers
Swap: 16779884k total,        0k used, 16779884k free, 19900836k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
22266 oracle    18   0 1195m 245m 166m R 76.7  0.8   0:06.99 oracle
22258 oracle    18   0 1195m 252m 173m D 67.8  0.8   0:08.21 oracle
22262 oracle    18   0 1195m 250m 171m R 65.2  0.8   0:06.80 oracle
22252 oracle    18   0 1243m 285m 171m D 56.6  0.9   0:09.45 oracle
 3669 root      15   0     0    0    0 S  3.0  0.0   1:18.20 rpciod
22268 osborne   16   0  2712 1080  752 R  1.0  0.0   0:00.14 top
 2403 root      16   0     0    0    0 S  0.7  0.0   0:01.27 kjournald
    6 root      RT   0     0    0    0 S  0.3  0.0   0:02.08 migration/2
 5286 gdm       16   0 23008  11m 6520 S  0.3  0.0   0:43.69 gdmgreeter
32281 oracle    16   0 1118m  45m  42m S  0.3  0.1   0:37.44 oracle
21318 oracle    16   0  317m  60m  23m S  0.3  0.2   0:31.27 java
11013 oracle    16   0 2769m  69m  65m S  0.3  0.2   0:24.33 oracle
14534 oracle    16   0 2769m  91m  85m S  0.3  0.3   2:05.54 oracle
    1 root      16   0  2492  596  512 S  0.0  0.0   0:02.80 init
    2 root      RT   0     0    0    0 S  0.0  0.0   0:00.39 migration/0
    3 root      34  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/0
    4 root      RT   0     0    0    0 S  0.0  0.0   0:05.66 migration/1

************Sort top by Time+****************

top - 18:31:13 up 4 days,  6:26,  1 user,  load average: 5.85, 4.03, 2.96
Tasks: 287 total,   5 running, 282 sleeping,   0 stopped,   0 zombie
Cpu(s): 24.1% us,  1.0% sy,  0.0% ni, 74.9% id,  0.1% wa,  0.0% hi,  0.0% si
Mem:  33274528k total, 23026440k used, 10248088k free,   600184k buffers
Swap: 16779884k total,        0k used, 16779884k free, 20638176k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
14202 oracle    17   0  781m 310m  26m S  0.0  1.0  11:11.16 java
24056 oracle    16   0  322m 189m  16m S  0.0  0.6   3:54.92 java
 4829 root      15   0 19228 8904 2488 S  0.0  0.0   2:49.64 X
22252 oracle    25   0 1232m 351m 248m R 99.9  1.1   2:49.43 oracle
22266 oracle    25   0 1192m 324m 249m R 99.3  1.0   2:47.68 oracle
22258 oracle    25   0 1185m 316m 249m R 99.9  1.0   2:47.52 oracle
22262 oracle    25   0 1186m 318m 249m R 99.9  1.0   2:46.05 oracle
 4368 root      15   0 16092  13m 3648 S  0.0  0.0   2:16.68 vmware-serverd
14534 oracle    16   0 2769m  91m  85m S  0.0  0.3   2:05.84 oracle
14259 oracle    25   0 87728  20m 9872 S  0.0  0.1   1:56.07 emagent
 3669 root      15   0     0    0    0 S  0.0  0.0   1:18.98 rpciod
21297 oracle    16   0  240m 7208 4244 S  0.0  0.0   1:12.02 opmn
14550 oracle    16   0 2775m  98m  93m S  0.0  0.3   1:09.92 oracle
14284 oracle    16   0 2769m 174m 170m S  0.0  0.5   1:09.91 oracle
 4216 root      16   0  9148 6416 1704 S  0.0  0.0   1:05.15 hald
 5385 oracle    15   0  145m 8332 4196 S  0.0  0.0   0:58.48 ocssd.bin
 5286 gdm       16   0 23008  11m 6520 S  0.0  0.0   0:43.72 gdmgreeter

***************show command line in top*****************

top - 18:35:18 up 4 days,  6:30,  1 user,  load average: 6.67, 5.36, 3.75
Tasks: 286 total,   5 running, 281 sleeping,   0 stopped,   0 zombie
Cpu(s): 24.3% us,  0.9% sy,  0.0% ni, 74.8% id,  0.0% wa,  0.0% hi,  0.0% si
Mem:  33274528k total, 23022792k used, 10251736k free,   600188k buffers
Swap: 16779884k total,        0k used, 16779884k free, 20638952k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
22266 oracle    25   0 1192m 324m 249m R 99.9  1.0   6:51.70 oracleLAB102 (DESCRIPTION=(LOCAL=YES)(
22252 oracle    25   0 1232m 351m 248m R 99.9  1.1   6:53.23 oracleLAB102 (DESCRIPTION=(LOCAL=YES)(
22258 oracle    25   0 1185m 316m 249m R 99.9  1.0   6:51.52 oracleLAB102 (DESCRIPTION=(LOCAL=YES)(
22262 oracle    25   0 1186m 318m 249m R 99.9  1.0   6:50.07 oracleLAB102 (DESCRIPTION=(LOCAL=YES)(
22737 osborne   16   0  3468 1096  756 R  1.3  0.0   0:00.42 top
   22 root      RT   0     0    0    0 S  0.3  0.0   0:02.02 [migration/10]
 4368 root      15   0 16092  13m 3648 S  0.3  0.0   2:16.79 /usr/sbin/vmware-serverd -s -d
 1574 oracle    16   0 2509m  23m  21m S  0.3  0.1   0:26.74 ora_ckpt_RANDY102
11007 oracle    16   0 2765m  33m  31m S  0.3  0.1   0:30.85 ora_ckpt_LAB111
11013 oracle    16   0 2769m  69m  65m S  0.3  0.2   0:24.53 ora_mmon_LAB111
    1 root      16   0  2492  596  512 S  0.0  0.0   0:02.81 init [5]
    2 root      RT   0     0    0    0 S  0.0  0.0   0:00.39 [migration/0]
    3 root      34  19     0    0    0 S  0.0  0.0   0:00.00 [ksoftirqd/0]
    4 root      RT   0     0    0    0 S  0.0  0.0   0:07.23 [migration/1]
    5 root      34  19     0    0    0 S  0.0  0.0   0:00.00 [ksoftirqd/1]
    6 root      RT   0     0    0    0 S  0.0  0.0   0:03.77 [migration/2]
    7 root      34  19     0    0    0 S  0.0  0.0   0:00.00 [ksoftirqd/2]

[homer:osborne:LAB102] /home/osborne/scripts > sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Aug 16 15:30:17 2007

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> @session4
Enter value for os_pid: 6917

    SID    SERIAL# USERNAME        OPTIMIZER_MODE         CPU    ELAPSED                                                            
------- ---------- --------------- --------------- ---------- ----------                                                            
SQL_TEXT                                                                                                                            
------------------------------------------------------------------------------------------------------------------------------------
     30      28935 KSO             CHOOSE                  .0         .0                                                            
select a.col2, sum(a.col1) from skew a, skew b group by a.col2                                                                      
                                                                                                                                    

SQL> l
  1  select s.sid sid,
  2         s.serial# serial#,
  3         s.username username,
  4         optimizer_mode,
  5         cpu_time/1000000 cpu,
  6         elapsed_time/1000000 elapsed,
  7         sql_text
  8    from v$sqlarea a, v$session s, v$process p
  9   where s.sql_hash_value = a.hash_value
 10     and s.sql_address    = a.address
 11     and s.username is not null
 12  and p.addr = s.paddr
 13* and p.spid = nvl('&os_pid',p.spid)


SQL> @active_sql

 SID PROG                   ADDRESS  HASH_VALUE ROWS_PROCESSED SQL_TEXT                                                             
---- ---------------------- -------- ---------- -------------- -----------------------------------------                            
  30 sqlplus@homer (TNS     A1C3F764  775795742              0 select a.col2, sum(a.col1) from skew a, s                            
                                                               kew b group by a.col2                                                
                                                                                                                                    
  24 TOAD.exe               A212371C 4098155192              1 declare ret binary_integer; begin ret :=                             
                                                               PBSDE.DEBUG_LOOP; end;                                               
                                                                                                                                    
                                                                                                                                                                              

SQL> @gen_dplan

3 rows deleted.

Enter value for hash_value: 775795742
Enter value for child_number: 0

5 rows created.


PLAN_TABLE_OUTPUT                                                                              
-----------------------------------------------------------------------------------------------
                                                                                               
--------------------------------------------------------------------                           
| Id  | Operation            |  Name       | Rows  | Bytes | Cost  |                           
--------------------------------------------------------------------                           
|   0 | SELECT STATEMENT     |             |       |       |       |                           
|   1 |  SORT GROUP BY       |             |       |       |       |                           
|   2 |   NESTED LOOPS       |             |       |       |       |                           
|   3 |    TABLE ACCESS FULL | SKEW        |       |       |       |                           
|   4 |    TABLE ACCESS FULL | SKEW        |       |       |       |                           
--------------------------------------------------------------------                           
                                                                                               
Note: rule based optimization                                                                  

12 rows selected.

SQL> @find_sql
Enter value for sql_text: %skew%
Enter value for address: 
Enter value for hash_value: 

ADDRESS  HASH_VALUE  CHILD      EXECS      ETIME     AVG_ETIME USERNAME      SQL_TEXT                                                                 
-------- ---------- ------ ---------- ---------- ------------- ------------- -----------------------------------------                                
CFC5C348 3484693604      0          0          0           .00 SYS           update skew set col1 = 3 where col1 = 5                                  
CFE7D888 1941848862      0          0          0           .00 SYS           EXPLAIN PLAN SET STATEMENT_ID='PLUS0' FOR                                
                                                                              select /*+ parallel (skew, 16) */ a.*,b.                                
                                                                             col1 b_col1 from skew a, old_temp_skew b                                 
                                                                             where a.pk_col = b.pk_col                                                
                                                                                                                                                      
CBB4BA18 1903985157      0          1    .151719           .15 SYS           select col1 from skew@KSO_LAB102 where ro                                
                                                                             wnum < 5                                                                 
                                                                                                                                                      
                      
                                                                                                                                                      
CB592BDC 3161363534      0          1    .072725           .07 SYS           select s.address, s.hash_value, s.executi                                
                                                                             ons execs, s.elapsed_time/1000000 etime,                                 
                                                                             decode(s.executions,0,0,(s.elapsed_time/1                                
                                                                             000000)/s.executions) avg_etime, s.text_s                                
                                                                             ubset from stats$sql_summary s where hash                                
                                                                             _value in (select hash_value from stats$s                                
                                                                             qltext t where t.sql_text like nvl('%skew                                
                                                                             %',t.sql_text))                                                          
                                                                                                                                                      
CFDBF0E0 3354043380      0          0          0           .00 SYS           select col1 from skew   
                                                 
CB7B8074 1883550465      0         14   29.20957          2.09 SYS           select avg(col1) from skew                                               
CB7B8074 1883550465      1          6 563.960596         93.99 SYS           select avg(col1) from skew                                               
CB7B8074 1883550465      2          0          0           .00 SYS           select avg(col1) from skew                                               

CFC5E580 1814216948      0          0          0           .00 SYS           EXPLAIN PLAN SET STATEMENT_ID='PLUS0' FOR                                
                                                                              update skew set col1 = 3 where col1 = 2                                 
                                                                                                                                                      
CFE82380 2871061432      0          0          0           .00 SYS           select /*+ parallel (skew, 16) */ a.*,b.c                                
                                                                             ol1 b_col1 from skew a, old_temp_skew b w                                
                                                                             here a.pk_col = b.pk_col                                                 
                                                                                                                                                      
CFDC1140 2360536733      0          0          0           .00 SYS           update skew set col1 = 3 where col1 = 100                                
                                                                             0                                                                        
                                                                                                                                                      
CBB23AF8  571404269      0          1    .111393           .11 SYS           EXPLAIN PLAN SET STATEMENT_ID='PLUS0' FOR                                
                                                                              select col1 from skew@kso_lab102 where r                                
                                                                             ownum < 5                                                                
                                                                                                                                                      
CFDCC704 1508312594      0          0          0           .00 SYS           alter table skew enable primary key                                      
CFC47FBC 3665890491      0          0          0           .00 SYS           update skew set col1 = 3 where col1 = 114                                
                                                                             058                                                                      
                                                                                                                                                      
CFC47FBC 3665890491      1          0          0           .00 SYS           update skew set col1 = 3 where col1 = 114                                
                                                                             058                                                                      
                                                                                                                                                      
CB58F6EC  614147379      0          2    .124164           .06 SYS           select distinct s.address, s.hash_value,                                 
                                                                             s.executions execs, s.elapsed_time/100000                                
                                                                             0 etime, decode(s.executions,0,0,(s.elaps                                
                                                                             ed_time/1000000)/s.executions) avg_etime,                                
                                                                              s.text_subset from stats$sql_summary s w                                
                                                                             here hash_value in (select hash_value fro                                
                                                                             m stats$sqltext t where t.sql_text like n                                
                                                                             vl('%skew%',t.sql_text))                                                 
                                                                                                                                                      
CBB4CA48  949573387      0          3    .148404           .05 SYS           select col1 from skew@kso_lab102 where ro                                
                                                                             wnum < 5                                                                 
                                                                                                                                                      
CBB4CA48  949573387      1          0          0           .00 SYS           select col1 from skew@kso_lab102 where ro                                
                                                                             wnum < 5                                                                 
                                                                                                                                                      
CFF47BE8 3432227276      0          0          0           .00 SYS           alter table skew parallel (degree 1)                                     


SQL> @trace_to_table_10g

Table dropped.


Table dropped.


Table dropped.


Directory created.


Table created.


WAIT_EVENTS
-----------
      10258


Table created.


   CURSORS
----------
         7


Table created.


  COUNT(*)
----------
        34


SQL> @profile
Enter value for event_name:

EVENT_NAME                               COUNT        MIN            MAX        AVG          TOTAL PERCENT_OF_TOTAL
----------------------------------- ---------- ---------- -------------- ---------- -------------- ----------------
SQL*Net message from client                 29     .00009       10.19022    1.10789       32.12874            84.12
db file scattered read                   10200     .00022         .00109     .00059        6.06260            15.87
log file sync                                1     .00068         .00068     .00068         .00068              .00
SQL*Net message to client                   28     .00001         .00001     .00001         .00025              .00


SQL> @profile_nothink
Enter value for event_name:
Enter value for thinktime_threshold: 1

EVENT_NAME                               COUNT        MIN            MAX        AVG          TOTAL PERCENT_OF_TOTAL
----------------------------------- ---------- ---------- -------------- ---------- -------------- ----------------
db file scattered read                   10200     .00022         .00109     .00059        6.06260            99.85
SQL*Net message from client                 24     .00009         .00075     .00035         .00846              .14
log file sync                                1     .00068         .00068     .00068         .00068              .01
SQL*Net message to client                   28     .00001         .00001     .00001         .00025              .00


SQL> @trace_histogram
Top Value: .0011
Buckets: 20
Enter value for event_name: db file scattered read

    BUCKET OCCURANCES   MIN_TIME   MAX_TIME   AVG_TIME   SUM_TIME PERCENT_OF_OCCURANCES PERCENT_OF_TIME
---------- ---------- ---------- ---------- ---------- ---------- --------------------- ---------------
         4          1    .000218    .000218    .000218    .000218                   .01             .00
         5          1    .000243    .000243    .000243    .000243                   .01             .00
         6          8    .000299    .000329   .0003165    .002532                   .08             .04
         7          7     .00033    .000381 .000357143      .0025                   .07             .04
         8         36    .000386    .000439 .000420306    .015131                   .35             .25
         9        110     .00044    .000494 .000467291    .051402                  1.08             .85
        10       1468    .000495    .000549 .000532306    .781425                 14.39           12.89
        11       4945     .00055    .000604 .000579569    2.86597                 48.48           47.27
        12       2800    .000605    .000659 .000627165   1.756062                 27.45           28.97
        13        530     .00066    .000714  .00068164    .361269                  5.20            5.96
        14        155    .000715    .000769 .000737871     .11437                  1.52            1.89
        15        123     .00077    .000824 .000789488    .097107                  1.21            1.60
        16          8    .000826     .00087  .00084275    .006742                   .08             .11
        17          5    .000881    .000933   .0009044    .004522                   .05             .07
        18          1    .000942    .000942    .000942    .000942                   .01             .02
        20          2    .001073     .00109   .0010815    .002163                   .02             .04
           ----------                                  ---------- --------------------- ---------------
sum             10200                                    6.062598                100.01          100.00

SQL> @awrrpt ...

WORKLOAD REPOSITORY report for

DB Name         DB Id    Instance     Inst Num Release     RAC Host
------------ ----------- ------------ -------- ----------- --- ------------
LAB102        1564028263 LAB102              1 10.2.0.1.0  NO  homer

              Snap Id      Snap Time      Sessions Curs/Sess
            --------- ------------------- -------- ---------
Begin Snap:      8898 16-Aug-07 15:01:05        21      16.7
  End Snap:      8899 16-Aug-07 16:01:07        20      16.9
   Elapsed:               60.04 (mins)
   DB Time:              234.55 (mins)

Cache Sizes
~~~~~~~~~~~                       Begin        End
                             ---------- ----------
               Buffer Cache:       284M       284M  Std Block Size:         8K
           Shared Pool Size:       500M       500M      Log Buffer:     6,996K

Load Profile
~~~~~~~~~~~~                            Per Second       Per Transaction
                                   ---------------       ---------------
                  Redo size:                484.81              8,478.06
              Logical reads:                 13.99                244.72
              Block changes:                  1.99                 34.79
             Physical reads:              2,782.02             48,650.33
            Physical writes:                  0.20                  3.51
                 User calls:                  0.15                  2.64
                     Parses:                  0.74                 12.98
                Hard parses:                  0.02                  0.33
                      Sorts:                  0.59                 10.40
                     Logons:                  0.01                  0.11
                   Executes:                  1.41                 24.59
               Transactions:                  0.06

  % Blocks changed per Read:   14.21    Recursive Call %:    98.65
 Rollback per transaction %:   81.55       Rows per Sort:     7.85

Instance Efficiency Percentages (Target 100%)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            Buffer Nowait %:  100.00       Redo NoWait %:  100.00
            Buffer  Hit   %:   99.84    In-memory Sort %:  100.00
            Library Hit   %:   99.00        Soft Parse %:   97.49
         Execute to Parse %:   47.24         Latch Hit %:  100.00
Parse CPU to Parse Elapsd %:  101.30     % Non-Parse CPU:   99.99

 Shared Pool Statistics        Begin    End
                              ------  ------
             Memory Usage %:   49.01   48.99
    % SQL with executions>1:   96.59   97.08
  % Memory for SQL w/exec>1:   83.60   84.81

Top 5 Timed Events                                         Avg %Total
~~~~~~~~~~~~~~~~~~                                        wait   Call
Event                                 Waits    Time (s)   (ms)   Time Wait Class
------------------------------ ------------ ----------- ------ ------ ----------
CPU time                                         14,072         100.0
direct path read temp            10,021,835          94      0    0.7   User I/O
control file parallel write           1,194          19     16    0.1 System I/O
os thread startup                        10           1     76    0.0 Concurrenc
log file parallel write                 245           0      1    0.0 System I/O

...


LSQL ordered by Elapsed Time          DB/Inst: LAB102/LAB102  Snaps: 8898-8899
-> Resources reported for PL/SQL code includes the resources used by all SQL
   statements called by the code.
-> % Total DB Time is the Elapsed Time of the SQL statement divided
   into the Total Database Time multiplied by 100

  Elapsed      CPU                  Elap per  % Total
  Time (s)   Time (s)  Executions   Exec (s)  DB Time    SQL Id
---------- ---------- ------------ ---------- ------- -------------
    13,959     13,947            0        N/A    99.2 535rbr9f8y8k9
Module: SQL*Plus
select a.col2, sum(a.col1) from skew a, skew b group by a.col2

         1          1            1        0.7     0.0 bunssq950snhf
insert into wrh$_sga_target_advice (snap_id, dbid, instance_number, SGA_SIZ
E, SGA_SIZE_FACTOR, ESTD_DB_TIME, ESTD_PHYSICAL_READS) select :snap_id, :dbi
d, :instance_number, SGA_SIZE, SGA_SIZE_FACTOR, ESTD_DB_TIME, ESTD_PHYSICAL_R
EADS from v$sga_target_advice

         0          0          720        0.0     0.0 803b7z0t84sq7
select job, nvl2(last_date, 1, 0) from sys.job$ where (((:1 <= next_date) and (n
ext_date < :2)) or ((last_date is null) and (next_date < :3))) and (field1 =
 :4 or (field1 = 0 and 'Y' = :5)) and (this_date is null) order by next_date, jo
b


...


LTablespace IO Stats                  DB/Inst: LAB102/LAB102  Snaps: 8898-8899
-> ordered by IOs (Reads + Writes) desc

Tablespace
------------------------------
                 Av      Av     Av                       Av     Buffer Av Buf
         Reads Reads/s Rd(ms) Blks/Rd       Writes Writes/s      Waits Wt(ms)
-------------- ------- ------ ------- ------------ -------- ---------- ------
TEMP
    10,018,329   2,781    0.0     1.0            0        0          0    0.0
SYSAUX
            97       0    0.2     1.0          252        0          0    0.0
UNDOTBS1
             0       0    0.0      .0          207        0          0    0.0
SYSTEM
             0       0    0.0      .0          100        0          0    0.0
 